#!/bin/bash

echo "MySQL数据库字典导出工具"
echo "========================"

# 检查Python是否安装
if ! command -v python3 &> /dev/null; then
    echo "错误: 未找到Python3，请先安装Python 3.7或更高版本"
    exit 1
fi

# 检查依赖库是否安装
echo "检查依赖库..."
python3 -c "import PyQt5, pymysql, openpyxl, docx, cryptography" 2>/dev/null
if [ $? -ne 0 ]; then
    echo "正在安装依赖库..."
    pip3 install -r requirements.txt
    if [ $? -ne 0 ]; then
        echo "错误: 依赖库安装失败"
        exit 1
    fi
fi

# 运行程序
echo "启动程序..."
python3 main.py
